BINARY=i2i
DIST_DIR=dist
VERSION=$(shell git describe --tags 2>/dev/null || echo "v1.0.0")

all: build

build:
	go build -o $(BINARY)

clean:
	rm -rf $(DIST_DIR) $(BINARY)

windows:
	GOOS=windows GOARCH=amd64 go build -o $(DIST_DIR)/$(BINARY)-windows-amd64.exe

linux:
	GOOS=linux GOARCH=amd64 go build -o $(DIST_DIR)/$(BINARY)-linux-amd64

darwin:
	GOOS=darwin GOARCH=amd64 go build -o $(DIST_DIR)/$(BINARY)-darwin-amd64

dist: clean windows linux darwin
	ls -la $(DIST_DIR)/

release:
	git tag $(VERSION)
	git push origin $(VERSION)
